package com.wizo.csb.records.exporter;

import java.io.Closeable;
import java.io.IOException;

/**
 * Used to export the collected records into a useful format.
 * @author ywu70
 *
 */
public interface RecordsExporter extends Closeable{
	/**
	 * Write a measurement to the exported format.
	 * 
	 * @param measurement Measurement name, for example "Total Operation Count".
	 * @param content Measuremnt content(int) to write
	 * @throws IOException if writing failed
	 */
	public void write(String measurement, int content) throws IOException;
	
	/**
	 * Write a measurement to the exported format.
	 * 
	 * @param measurement Measurement name, for example "Average Latency(ms)".
	 * @param content Measuremnt content(double) to write
	 * @throws IOException if writing failed
	 */
	public void write(String measurement, double content) throws IOException;
	
	/**
	 * Write a measurement to the exported format.
	 * 
	 * @param measurement Measurement name, for example "| Time(s)                  |".
	 * @param content Measuremnt content(String) to write
	 * @throws IOException if writing failed
	 */
	public void write(String measurement, String content) throws IOException;
	
	/**
	 * Write content directly to the exported format.
	 * 
	 * @param content Some contents are not directly related to those measurements.
	 * @throws IOException if writing failed. 
	 */
	public void write(String content) throws IOException;
}
